<template>
  <div class="son" style="border: 3px solid #000; margin: 10px">
    我是Son组件 --- {{ title }} --- {{ hobby }}
    <p></p>
    <button @click="changeTitle">修改标题</button>
  </div>
</template>

<script>
export default {
  name: "Son-Child",
  props: ["title", "hobby"],
  methods: {
    changeTitle() {
      // 1. 通过$emit发射自定义事件告知父组件修改数据
      // this.$emit('自定义事件名称', 修改的值)
      this.$emit("changeTitle", "黑马程序员");
    },
  },
};
</script>

<style>
</style>